package com.xgp.jvm;

public class Demo4 {
    public static void main(String[] args) {
        //最大内存
        long max = Runtime.getRuntime().maxMemory();

        //jvm中内存
        long total = Runtime.getRuntime().totalMemory();

        System.out.println("max = " + max + "字节\t" + (max/(double)1024/1024) + "MB");
        System.out.println("total = " + total + "字节\t" + (total/(double)1024/1024) + "MB");
    }
}
